

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "CBLEDataMsg.h"
#import "RHLocalSettingModel.h"

#define CMD_ADDRESS        @"CMD_ADDRESS"       //寄存器地址
#define CMD_ADDRESS_VALUE  @"CMD_ADDRESS_VALUE" //寄存器值
#define CMD_TYPE           @"CMD_TYPE"          //操作的端点 EMS,MASTER,PACK
#define CMD_CODE           @"CMD_CODE"          //功能码  03读多个寄存器  10写多个寄存器

@interface CBLEDataParse : NSObject
@property(nonatomic,strong)MsgDataWristAck *ackData;
+(instancetype)dataParse;
-(NSString*)parseMacAddr:(CBCharacteristic*)chrtcs;
-(NSInteger)parseCmdAck:(CBCharacteristic*)chrtcs;
-(NSInteger)parseOTAAck:(CBCharacteristic*)chrtcs;
-(NSInteger)parseAppOTAAck:(CBCharacteristic*)chrtcs;

///解析收到的数据
+(NSDictionary*)parseReceiveData:(NSData*)data;
///根据模型对数据进行解析
+(NSString*)parseData:(NSData*)data settingModel:(RHLocalSettingModel*)settingModel;

+(int)offsetValueWithBitWidth:(int)bitWith;
@end
